import Vue from "vue";
/**
 * @desc 自动检索当前目录下所有.vue后缀文件 所有.vue有写name名称的自动导入
 * @example test.vue
 *   <template>
 *     <div>test</div>
 *    </template>
 *    <script>
 *      export default {
 *        name:'test'
 *      }
 *    </script>
 */
const files = require.context("./", true, /\.vue$/);
let components = {}
files.keys().forEach((key) => {
	let component = files(key)?.default;
	if (!component?.name) return;
	components[component.name] = component
});
export default components;
